﻿<span class="itemdisplay">
    <span class="mdi mdi-file-word">@Count</span>
</span>

@code {
    [Parameter]
    public Document Document { get; set; }

    private string Count { get; set; }

    protected override void OnParametersSet()
    {
        int len = Document.CountWords();
        if (len < 1000)
        {
            Count = len.ToString();
        }
        else
        {
            Count = $"{(len / 1000.0).ToString("f1")}k";
        }
    }
}
